<div class="main-content-header"></div>
<div
	class="main-content-body">
	<?php foreach($appdetails as $app):?>
	<div class="box-app-info">
		<div class="icon-box">
			<div class="icon-wrapper">
				<img src="<?php echo base_url('src/imagescontent/'.$app->images)?>"
					onerror="this.src='<?php echo base_url('src/imagescontent/app-fail-76.jpg')?>'"
					alt="Tải app " class="app-image" width="80" height="80"> <a
					href="#" title="Tải app " class="mask white-big-mask"></a>
			</div>
			<!--end .icon-wrapper-->
			<!-- <div id="ratestars" data-rating="4" style="display:inline;"></div> -->
			<ul class="Star star-bg clickable">
				<li style="cursor: pointer; width: 100px;" id="ratestars"
					data-rating="4"><img
					src="<?php echo base_url('src/store/details_files/star-on.png')?>"
					alt="1" title="bad">&nbsp;<img
					src="<?php echo base_url('src/store/details_files/star-on.png')?>"
					alt="2" title="poor">&nbsp;<img
					src="<?php echo base_url('src/store/details_files/star-on.png')?>"
					alt="3" title="regular">&nbsp;<img
					src="<?php echo base_url('src/store/details_files/star-on.png')?>"
					alt="4" title="good">&nbsp;<img
					src="<?php echo base_url('src/store/details_files/star-on.png')?>"
					alt="5" title="gorgeous"><input value="4" name="score"
					type="hidden"></li>
			</ul>
			<div id="rating-error"></div>

			<p class="center p20l">
			<?php echo $app->likelog;?>
				bình chọn
			</p>
		</div>
		<!--end .icon-box-->
		<div class="app-info">
			<p class="app-title">
			<?php echo $app->namecontent;?>
			</p>
			<p>
			
			
			<div class="fb-like" data-send="true" data-width="450"
				data-show-faces="true"></div>
			</p>
			<p>
				Lượt Tải:
				<?php echo $app->downlog;?>
			</p>
			<p>
				Dòng máy:
				<?php foreach($types as $type):?>
				<?php if($app->typeid == $type->id):?>
				<?php echo $type->nametype;?>
				<?php endif;?>
				<?php endforeach;?>
			</p>
			<p>
				Thể loại:
				<?php foreach($caties as $cate):?>
				<?php if($app->cateid == $cate->id):?>
				<?php echo $cate->catename;?>
				<?php endif;?>
				<?php endforeach;?>
			</p>
			<p>
				Lượt view:
				<?php echo $app->countlog;?>
			</p>
			<p>Phiên bản: 1.1</p>
			<?php if( $this->session->userdata('upid') <> 0):?>
			<a href="<?php echo base_url('apps/'.$app->ifiles)?>"
				title="Tải app iphone Gói trò chơi- iOS"
				class="download-by-com Download" id="111736">Tải Xuống Máy</a> <a
				title="Tải app iphone Gói trò chơi- iOS"
				href="http://chart.apis.google.com/chart?chs=250x250&amp;cht=qr&amp;chld=L%7C0&amp;chl=<?php echo base_url('apps/'.$app->ifiles)?>"
				class="download-by-phone AsPhone" id="111736">Tải Bằng Điện Thoại</a>
				<?php else:?>
			<b>DOWNLOAD: <font color="red">Yêu cầu bạn phải đăng nhập.</font> </b>
			<?php endif;?>
			<div class="clear"></div>
		</div>
		<!--end .app-info-->
		<br class="clear">
	</div>
	<div style="padding:10px 10px 10px 10px;">&nbsp;</div>

	<!--end .box-app-info-->
	<div class="clear"></div> 
	<div id="tabs">
		<ul>
			<li><a href="#tabs-3">Screenshot</a></li>
			<li><a href="#tabs-2">Giới thiệu</a></li>
			<li><a href="#tabs-1">Tác giả</a></li>
		</ul>
		<div id="tabs-3">
			<p>
			
			
			<div style="position: relative;"
				class="jcarousel-clip jcarousel-clip-horizontal">
				<ul
					style="overflow: hidden; position: relative; top: 0px; margin: 0px; padding: 0px; left: 0px; width: 282px;"
					class="ss-list jcarousel-screenshot-product jcarousel-list jcarousel-list-horizontal"
					id="screenshot-product">
					<li jcarouselindex="1"
						style="float: left; list-style: none outside none; width: 172px;"
						class="jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal">
						<img alt="Không có ảnh giới thiệu"
						src="<?php echo base_url("src/imagescontent/".$app->ifiles_2)?>"
						style="max-height: 160px; max-width: 110px;">
					</li>
					<li jcarouselindex="1"
						style="float: left; list-style: none outside none; width: 172px;"
						class="jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal">
						<img alt="Không có ảnh giới thiệu"
						src="<?php echo base_url("src/imagescontent/".$app->ifiles_3)?>"
						style="max-height: 160px; max-width: 110px;">
					</li>
				</ul>
			</div>
			</p>
		</div>
		<div id="tabs-2">
			<p>
			<?php echo $app->description;?>
			</p>
		</div>
		<div id="tabs-1">
			<p>
			<?php foreach($userinfo as $user):?>
			<?php if($user->id == $app->userid):?>
			<?php echo $user->username;?>
			<?php endif;?>
			<?php endforeach;?>
			</p>

		</div>
	</div>

	<?php endforeach;?>
	<!--end .box-review-->
	<div class="box-similar">
		<div class="simple-title">
			<span>Ứng Dụng Tương Tự</span>
		</div>
		<!--end .simple-title-->
		<ul class="app-list">
		<?php foreach($relate_app as $relate):?>
			<li>
				<div class="app-box">
					<div class="app-thumb">
						<img
							src="<?php echo base_url("src/imagescontent/".$relate->images)?>" 
							alt="Tải app iphone android - <?php echo $relate->namecontent;?>"
							onerror="this.src='<?php echo base_url("src/imagescontent/app-fail-76.jpg")?>'"
							width="80" height="80"> <a target="_blank"
							href="<?php echo site_url("home/appdetail/".mb_strtolower(url_title(removesign($relate->namecontent))))?>"
							class="mask white-mask" title="Tải app"></a>
					</div>
					<!--end .app-thumb-->
					<p class="app-title-2 center">
						<a target="_blank" title="Tải app"
							href="<?php echo site_url("home/appdetail/".mb_strtolower(url_title(removesign($relate->namecontent))))?>">
							<?php echo $relate->namecontent; ?> </a>
					</p>
					<p class="app-fact-2  center">
					<?php foreach($types as $type):?>
					<?php if($relate->typeid == $type->id):?>
					<?php echo $type->nametype;?>
					<?php endif;?>
					<?php endforeach;?>
						-
						<?php foreach($caties as $cate):?>
						<?php if($relate->cateid == $cate->id):?>
						<?php echo $cate->catename;?>
						<?php endif;?>
						<?php endforeach;?>
					</p>
					<p class="ellipsis  center">
						Lượt tải:
						<?php echo $relate->downlog;?>
					</p>
					<ul id="ratestars" class="Star">
						<li><a href="#" class="pRating" data-score="1">Star</a></li>
						<li><a href="#" class="pRating" data-score="2">Star</a></li>
						<li><a href="#" class="pRating" data-score="3">Star</a></li>
						<li><a href="#" class="pRating" data-score="4">Star</a></li>
						<li class="Trong"><a class="pRating" href="#" data-score="5">Star</a>
						</li>
					</ul>
					<div class="clear"></div>
					<?php if( $this->session->userdata('upid') <> 0):?>
					<a href="<?php echo base_url('apps/'.$relate->ifiles)?>"
						id="111595" class="download-btn Download">Tải</a>
						<?php else:?>
					<a href="#" id="111595" class="download-btn Download">Tải</a>
					<?php endif;?>
				</div> <!--end .app-box-->
			</li>
			<?php endforeach;?>
		</ul>
		<div class="clear"></div>
	</div>
	<!--end .box-similar-->
	<div class="box-comment">
		<div class="simple-title">
			<span>Bình Luận</span>
		</div>
		<?php if($this->session->userdata('upid') <> 0):?>
	<div class="type-cmt-box">
		<div class="FormComment" id="linkComment">
			<div class="resultajax"></div>
			<div class="Comment01">
				<script type="text/javascript">
		            function submit_comment() {
		            	var content =  document.getElementById("comment_content").value; 
		                dataString = {'con':content,'postid':<?php echo $content_id;?>};
		                $.ajax({
		                    url: "<?php echo base_url() . 'home/add_comment/'; ?>",
		                    type: 'POST',
		                    data: dataString,
		                    dataType: "text",
		                    success: function(output_string) {
		                        $(".resultajax").html(output_string);
		                    }
		                });
		            } 
		        </script>
				<fieldset>
					<textarea class="comment_content" id="comment_content"
						name="comment_content" cols="100"></textarea>
					<button class="BtnSubmit" style="float: right;"
						onclick="submit_comment()">Gửi bình luận</button>
				</fieldset>

				<div class="warning" id="comment_error" style="display: none;"></div>
			</div>
		</div>
	</div>
	<?php else:?>
	<div class="type-cmt-box">
		<div class="FormComment" id="linkComment">Đăng nhập để thảo luận đánh
			giá.</div>
	</div>
	<?php endif;?>
		<div class="cmt-wrapper">
			<ul id="ListComment" class="ListComment emotion">
			<?php foreach($list_comment as $comment): ?>
				<li><span rel_f="1"
					rel="ZMEA_phuongthehe9x?l=2&amp;width=80&amp;height=80"
					class="avarta" id="image2_1534"><a id="image2_1534L"
						target="_blank"
						href="<?php echo site_url('store/'.$comment->userid);?>"><img
							k="a.n.phuongthehe9x.50" l="2" id="wgaimage2_1534" m="0"
							src="details_files/phuongthehe9x_50_2.jpg"
							onerror="this.src='http://widget.me.zing.vn/images/160.gif';"
							width="80" height="80"> </a> </span>
					<div class="Comment">
						<h3 rel_f="1" rel="ZMED_phuongthehe9x?l=2" id="user2_1534">
							<a target="_blank"
								href="<?php echo site_url('store/'.$comment->userid);?>"> <?php foreach($userinfo as $user): ?>
								<?php if($user->id == $comment->userid):?> <?php echo $user->username;?>
								<?php endif;?> <?php endforeach;?> </a>
						</h3>
						<p style="word-wrap: break-word;">
							<span class="emotion_show 5"><img src="details_files/6.gif"
								title="big grin"> </span>
								<?php echo $comment->content;?>
						</p>
						<p class="Date">
						<?php echo $comment->createtime;?>
						</p>
					</div>
					<div class="clear"></div>
					<div class="cmt-arrow"></div>
				</li>
				<?php endforeach;?>
			</ul>
		</div>
	</div>
	
</div>
